package cn.iocoder.yudao.module.student.controller.app.banner;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import cn.iocoder.yudao.module.member.api.banner.BannerApi;
import cn.iocoder.yudao.module.member.api.banner.dto.BannerPageReqDTO;
import cn.iocoder.yudao.module.member.api.banner.dto.BannerRespDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Api(tags = "管理后台 -学生端- banner")
@RestController
@RequestMapping("/student/banner")
@Validated
public class StudentBannerController {

    @Resource
    private BannerApi bannerApi;


    @GetMapping("/page")
    @ApiOperation("获得banner分页")
    public CommonResult<PageResult<BannerRespDTO>> getBannerPage(@Valid BannerPageReqDTO pageVO){
        PageResult<BannerRespDTO> pageResult = bannerApi.getBannerPage(pageVO);
        return success(pageResult);
    }


}
